import { GCellRenderer } from "../../../../com/mui/controls/GCellRenderer";
import { ObjCreate } from "../common/ObjCreate";
import { GlobalStyle } from "../../../common/global/GlobalStyle";
import { ItemData } from "../../resource/info/ItemData";
import { HTMLUtil } from "../../../../com/gengine/utils/HTMLUtil";
import { ColorConfig } from "../../resource/ColorConfig";
import { GTextFiled } from "../../../../com/mui/controls/GTextFiled";
type int = number;
//class SpiritEquipCoinReturnCellRenderer
    
    export  class SpiritEquipCoinReturnCellRenderer extends GCellRenderer
    {
        constructor()
        {
            super();
            this._nameTxt = ObjCreate.createGTextField("", 0, 0, 220, 20, this);
            this._nameTxt.autoSize = flash.text.TextFieldAutoSize.LEFT;
            this._valueTxt = ObjCreate.createGTextField("", 110, 0, 220, 20, this, GlobalStyle.textFormatGreen);
            this._valueTxt.autoSize = flash.text.TextFieldAutoSize.LEFT;
            this.mouseEnabled = false;
            return;
        }

        public /* override */ set data(arg1: Object)
        {
            super.data = arg1;
            if (arg1) 
            {
                this._itemCode = int(arg1["itemCode"]);
                this._value = int(arg1["value"]);
                this._itemData = new ItemData(this._itemCode);
                this._nameTxt.htmlText = HTMLUtil.addColor(this._itemData.name + "+" + arg1["strength"], ColorConfig.instance.getItemColor(this._itemData.color).color);
                this._valueTxt.text = this._value.toString();
            }
            return;
        }

        /* internal */ /* var */_nameTxt: GTextFiled;

        /* internal */ /* var */_valueTxt: GTextFiled;

        /* internal */ /* var */_itemCode: int;

        /* internal */ /* var */_itemData: ItemData;

        /* internal */ /* var */_value: int;
    }
